Skip to content

fix(zapier): Read every page of the project list, and bound each list loop - #45

Merged
johnxie merged 2 commits into
masterfrom
fix/zapier-list-pagination
Nov 19, 2026
Merged

johnxie merged 2 commits into
masterfrom
fix/zapier-list-pagination

Conversation

@johnxie

@johnxie johnxie commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

The bug

get_all_projects (src/triggers/getAllProjects.ts) sets canPaginate: true, but perform never read bundle.meta.page. With no folder selected, it called GET /api/v1/me/projects with no page and no limit.

The public API reference gives that endpoint two query parameters: limit (default 100) and page (default 1). So the first request returned projects 1 to 100. When the user clicked "Load more", Zapier sent bundle.meta.page = 1, and the app sent the same request again.

Failing input: a user with 150 projects and an empty Workspace or Folder field. "Load more" shows projects 1 to 100 again. Projects 101 to 150 never show.

The fix

  • get_all_projects turns bundle.meta.page (0 for the first page) into page (1 for the first page) and sends limit=100.
  • For a folder, GET /folders/{folderId}/projects takes no page parameter. A later page now returns no rows, so "Load more" does not repeat the list.
  • dropdownPageParams returns no request at page 20 and after (MAX_PAGES in src/client.ts). A response that ignores page cannot make the dropdown load the same rows forever.

The same bug in other list calls

List call Endpoint Before Change
get_all_agents GET /folders/{folderId}/agents (page, limit) First 100 rows only Pages, canPaginate
get_all_project_templates GET /folders/{folderId}/project-templates (page, limit, default 20) First 20 rows only Pages, canPaginate
get_all_assignable_members GET /projects/{projectId}/members (page, limit, default 20) First 20 rows only Pages, canPaginate
find_project GET /me/projects Matched the first 100 projects only Reads every page, at most 20
n8n taskadeApiRequestPagedItems and taskadeApiRequestCursorItems v2 list calls Paged correctly, with no page bound At most 100 pages

The n8n helpers stop at a short page. But with no limit (Return All, the member dropdown and the template dropdown), a response that ignored page or after made them loop forever. The new tests show this with a fake API that throws after 1,000 requests.

Not changed, because the fix has a different shape:

  • get_all_tasks, find_task and get_all_blocks read the first 100 rows of a cursor list (after). A Zapier dropdown needs z.cursor to page a cursor list.
  • get_all_spaces already pages with bundle.meta.page, and its endpoints take no page parameter.
  • The Make app already pages each paged list, and Make stops each list at response.limit.

No trigger key, action key, input field or sample changes.

Tests

  • src/test/pagination.test.ts: 13 tests with a fake API that honours page and limit. Before the fix, 12 failed. After the fix, all 42 Zapier tests pass.
  • packages/n8n-nodes-taskade/test/Taskade.node.test.ts: 2 new page bound tests. Before the fix, both failed with "runaway loop: more than 1,000 requests". After the fix, all 51 n8n tests pass.

… loop

The project dropdown (get_all_projects) sets canPaginate, but it ignored
bundle.meta.page. Each "Load more" sent GET /me/projects with no page
parameter, so it showed the first 100 projects again. A user with more than
100 projects never saw the rest.

- get_all_projects sends page and limit to GET /me/projects. For a folder,
  GET /folders/{folderId}/projects takes no page parameter, so a later page
  returns no rows.
- get_all_agents, get_all_project_templates and get_all_assignable_members
  page the same way. Templates and members showed only the 20 rows of the
  default page before.
- find_project reads every page of GET /me/projects before it matches.
- Each Zapier list reads at most 20 pages (MAX_PAGES in src/client.ts).
- The n8n list helpers read at most 100 pages. Before, a response that
  ignored page or after made Return All and two dropdowns loop forever.

Trigger keys, action keys, input fields and samples do not change.
Copilot AI lite review requested due to automatic review settings November 19, 2026 05:43
@johnxie
johnxie merged commit effbbd6 into master Nov 19, 2026
6 checks passed
@johnxie
johnxie deleted the fix/zapier-list-pagination branch November 19, 2026 05:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The pagination guard limits requests but still appends repeated pages, causing duplicate project results when the API ignores the page parameter.

1 open issue
What changed in this PR

This pull request fixes pagination across the Zapier and n8n Taskade integrations so larger collections can load completely while malformed API responses cannot cause unbounded request loops.

Changes:

  • Adds page and limit handling for Zapier project, agent, template, and member dropdowns.
  • Updates project search to read multiple pages with a 20-page limit.
  • Bounds n8n cursor- and page-based list helpers at 100 pages.
  • Adds pagination regression tests and changelog entries.
File Description
src/​triggers/​getAllProjectTemplates.ts Adds paginated retrieval for project-template dropdown results.
src/​triggers/​getAllProjects.ts Reads requested project pages and prevents repeated folder results.
src/​triggers/​getAllAssignableMembers.ts Adds paginated retrieval for project-member dropdown results.
src/​triggers/​getAllAgents.ts Adds paginated retrieval for agent dropdown results.
src/​test/​pagination.test.ts Adds Zapier pagination and page-bound regression tests.
src/​searches/​findProject.ts Searches across multiple account-level project pages.
src/​client.ts Adds shared pagination parameters, page bounds, and bounded multi-page request helpers.
packages/​n8n-nodes-taskade/​test/​Taskade.node.test.ts Adds tests covering n8n pagination bounds.
packages/​n8n-nodes-taskade/​nodes/​Taskade/​GenericFunctions.ts Bounds n8n cursor- and page-based list loops.
packages/​n8n-nodes-taskade/​CHANGELOG.md Documents the n8n pagination safety-bound changes.
CHANGELOG.md Documents the Zapier pagination fixes.

Review effort: Lite

Comment thread src/client.ts
Comment on lines +72 to +80
const items: Array<Record<string, unknown>> = [];
for (let page = 1; page <= MAX_PAGES; page++) {
const response = await request(z, bundle, {
method: 'GET',
path,
params: { limit: String(PAGE_SIZE), page: String(page) },
});
const pageItems = parseOk(z, response.json).items ?? [];
items.push(...pageItems);
@johnxie

johnxie commented Nov 28, 2026

Copy link
Copy Markdown
Member Author

@deanzaka impact and QA notes for this PR.

Impact

Area Who sees it What changes Risk
Zapier "Project" dropdown with no Workspace or Folder Zapier users with more than 100 projects "Load more" reads the next page. Before, it showed projects 1 to 100 again Low
Zapier "Project" dropdown in a folder Zapier users "Load more" returns no rows, so the list does not repeat Low
Zapier AI agent, project template and project member dropdowns Zapier users They read 100 rows a page and page with "Load more" Low
Zapier "Find Project" with no folder Zapier users It searches every page, at most 20 pages (2,000 projects) Low
n8n list calls: Return All, member and template dropdowns n8n users A list reads at most 100 pages (10,000 rows) Low

No trigger key, action key, input field or sample changes.

Release: the Zapier fix is in 1.3.1 in CHANGELOG.md, and the Zapier page data names 1.3.1. The n8n fix is under "Unreleased" in the n8n changelog. npm latest is 1.0.1, so n8n users get it after the next n8n-v<version> tag.

Before and after

BEFORE  Zapier, 150 projects, Workspace or Folder empty
Project dropdown
  first page    projects 1-100
  [Load more]   projects 1-100 again
  projects 101-150 never show
AFTER
Project dropdown
  first page    projects 1-100
  [Load more]   projects 101-150
  [Load more]   no rows, the list ends

How to QA

# Step Expected result
1 In a clone, run yarn install --frozen-lockfile && yarn build && yarn test The tests pass, with the pagination tests from src/test/pagination.test.ts
2 Run cd packages/n8n-nodes-taskade && npm ci --ignore-scripts && npm test The tests pass, with the two "page bound" tests
3 In a Zap, use a Taskade account with more than 100 projects. Add Create Task, leave "Workspace or Folder" empty, open "Project" and click "Load more" The next projects show. The first 100 do not show again
4 In the same action, pick a folder, open "Project" and click "Load more" No project shows two times
5 Add "Find Project", leave the folder empty, and search for a project after the first 100 Zapier finds the project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants